<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Clock</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: #091921;
        }

        body.light {
            background: #d1dae3;
        }

        .clock {
            width: 350px;
            height: 350px;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #091921;
            border: 20px solid #091921;
            border-radius: 50%;
            box-shadow: -8px -8px 15px rgba(255, 255, 255, 0.05),
                20px 20px 20px rgba(0, 0, 0, 0.3),
                inset -8px -8px 15px rgba(255, 255, 255, 0.05),
                inset 20px 20px 20px rgba(0, 0, 0, 0.3);
        }

        body.light .clock {
            background: #d1dae3;
            border: 20px solid #cad3dc;
            box-shadow: -8px -8px 15px rgba(255, 255, 255, 0.5),
                10px 10px 10px rgba(0, 0, 0, 0.3),
                inset -8px -8px 15px rgba(255, 255, 255, 0.5),
                inset 10px 10px 10px rgba(0, 0, 0, 0.3);
        }

        .clock::before {
            content: '';
            position: absolute;
            height: 15px;
            width: 15px;
            background: #fff;
            border-radius: 50%;
            z-index: 100000;
        }

        body.light .clock::before {
            background: #008eff;
        }

        .indicators div {
            position: absolute;
            width: 2px;
            height: 15px;
            background: #404040;
        }

        .indicators div:nth-child(1) {
            transform: rotate(30deg) translateY(-130px) translateX(-3px);
        }

        .indicators div:nth-child(2) {
            transform: rotate(60deg) translateY(-130px) translateX(-5px);
        }

        .indicators div:nth-child(3) {
            transform: rotate(120deg) translateY(-130px) translateX(-5px);
        }

        .indicators div:nth-child(4) {
            transform: rotate(150deg) translateY(-130px) translateX(-2px);
        }

        .indicators div:nth-child(5) {
            transform: rotate(210deg) translateY(-130px) translateX(4px);
        }

        .indicators div:nth-child(6) {
            transform: rotate(240deg) translateY(-130px) translateX(6px);
        }

        .indicators div:nth-child(7) {
            transform: rotate(300deg) translateY(-130px) translateX(5px);
        }

        .indicators div:nth-child(8) {
            transform: rotate(330deg) translateY(-130px) translateX(2px);
        }

        body.light .indicators div {
            background: #808080;
        }

        .nums {
            position: absolute;
            font-size: 30px;
            font-weight: bold;
            color: #808080;
        }

        #three {
            position: absolute;
            left: 120px;
            top: -15px;
        }

        #six {
            position: absolute;
            top: 110px;
            left: -8px;
        }

        #nine {
            position: absolute;
            right: 120px;
            top: -15px;
        }

        #twelve {
            position: absolute;
            bottom: 110px;
            left: -15px;
        }

        .clock .hour,
        .clock .min,
        .clock .sec {
            position: absolute;
            z-index: 10;
        }

        .hour,
        .hr {
            height: 160px;
            width: 160px;
        }

        .min,
        .mn {
            height: 190px;
            width: 190px;
        }

        .sec,
        .sc {
            height: 230px;
            width: 230px;
        }

        .hr,
        .mn,
        .sc {
            display: flex;
            justify-content: center;
            position: absolute;
            border-radius: 50%;
        }

        .hr::before {
            content: '';
            position: absolute;
            width: 8px;
            height: 80px;
            background: #ff105e;
            z-index: 10;
            border-radius: 6px 6px 0 0;
        }

        .mn::before {
            content: '';
            position: absolute;
            width: 4px;
            height: 90px;
            background: #ffffff;
            z-index: 11;
            border-radius: 6px 6px 0 0;
        }

        body.light .mn::before {
            background: #091921;
        }

        .sc::before {
            content: '';
            position: absolute;
            width: 2px;
            height: 150px;
            background: #008eff;
            z-index: 12;
            border-radius: 6px 6px 0 0;
        }

        .time {
            height: 20px;
            position: absolute;
            top: 60%;
            padding: 0 5px;
            border: 1px solid #091921;
            background: #091921;
            border-radius: 5px;
            color: #808080;
            font-weight: bold;
            box-shadow: 5px 5px 10px rgba(255, 255, 255, 0.1), -5px -5px 10px rgba(255, 255, 255, 0.1);
        }

        body.light .time {
            color: #606060;
            border: 1px solid #CAD3E3;
            background: #CAD3E3;
            box-shadow: 5px 5px 10px rgba(255, 255, 255, 0.5), -5px -5px 10px rgba(255, 255, 255, 0.5);
        }

        .toggleClass {
            position: absolute;
            top: 30px;
            right: 150px;
            width: 20px;
            height: 20px;
            font-size: 18px;
            border-radius: 50%;
            background: #d1dae3;
            color: #d1dae3;
            font-family: monospace;
            cursor: pointer;
            display: flex;
            align-items: center;
        }

        .toggleClass::before {
            position: absolute;
            left: 25px;
            content: 'Light Mode';
            white-space: nowrap;
        }

        body.light .toggleClass {
            background: #091921;
            color: #091921;
        }

        body.light .toggleClass::before {
            content: 'Dark Mode';
        }
    </style>
</head>

<body class="light">
    <div class="clock">
        <div class="hour">
            <div class="hr" id="hr"></div>
        </div>
        <div class="min">
            <div class="mn" id="mn"></div>
        </div>
        <div class="sec">
            <div class="sc" id="sc"></div>
        </div>
        <div class="indicators">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
        <div class="nums">
            <span id="three">3</span>
            <span id="six">6</span>
            <span id="nine">9</span>
            <span id="twelve">12</span>
        </div>
        <div class="time"></div>
    </div>
    <div class="toggleClass" onclick="toggleClass()"></div>
    <script>
        function toggleClass() {
            const body = document.querySelector('body');
            body.classList.toggle('light');
        }

        const hr = document.querySelector('#hr');
        const mn = document.querySelector('#mn');
        const sc = document.querySelector('#sc');
        const time = document.querySelector('.time');

        setInterval(() => {
            let day = new Date();
            let hour = day.getHours();
            let min = day.getMinutes();
            let sec = day.getSeconds();

            let hrPosition = hour * 30 + min / 2      //hour * 360/12 + ((min * 360/60)/12)
            let minPosition = min * 6;             //min * 360/60
            let secPosition = sec * 6;           //sec * 360/60

            hr.style.transform = `rotateZ(${hrPosition}deg)`;
            mn.style.transform = `rotateZ(${minPosition}deg)`;
            sc.style.transform = `rotateZ(${secPosition}deg)`;

            if (sec < 10) {
                sec = '0' + sec;
            }
            if (min < 10) {
                min = '0' + min;
            }
            if (hour < 10) {
                hour = '0' + hour;
            }

            time.textContent = hour + ' : ' + min + ' : ' + sec;

        }, 1000);
    </script>
</body>

</html>